﻿fn test_first_word() {
	loop{
		let mut origin_string = String::new();
		io::stdin().read_line(&mut origin_string).expect("fail");
		let word = first_word(&origin_string);
		println!("first word is {}", word);
	}
}

fn first_word(origin_string: &String) -> &str {
	for (idx, elem) in origin_string.chars().enumerate() {
		if elem == ' ' {
			return &origin_string[..idx];
		}
	}
	return &origin_string[..];
}